#!/usr/bin/python
import Prototypes
h1='h1'
h2='h2'
h3='h3'
h4='h4'
h5='h5'
h6='h6'

class Header(Prototypes.Tag,Prototypes.Renderable):
	def __init__(self):
		Prototypes.Tag.__init__(self)
		self.tag = h1
		self.text=""

	def render(self,renderer):
		renderer.write(text)

class Table(Prototypes.Tag,Prototypes.Container,Prototypes.Renderable):
	def __init__(self):
		Prototypes.Container.__init__(self)
		Prototypes.Tag.__init__(self)
		self.tag = "table"
	
	def render(self,renderer):
		self.render_tag(renderer)
		self.render_contained(renderer)
		self.render_close(renderer)

class Row(Prototypes.Tag,Prototypes.Container,Prototypes.Renderable):
	def __init__(self):
		Prototypes.Container.__init__(self)
		Prototypes.Tag.__init__(self)
		self.tag = "tr"

	def render(self,renderer):
		self.render_tag(renderer)
		self.render_contained(renderer)
		self.render_close(renderer)

class Data(Prototypes.Tag,Prototypes.Container,Prototypes.Renderable):
	def __init__(self):
		Prototypes.Container.__init__(self)
		Prototypes.Tag.__init__(self)
		self.tag="td"

	def render(self,renderer):
		self.render_tag(renderer)
		self.render_contained(renderer)
		self.render_close(renderer)

class Text(Prototypes.Tag,Prototypes.Renderable):
	def __init__(self):
		Prototypes.Tag.__init__(self)
		self.tag="span"
		self.text=""

	def render(self,renderer):
		self.render_tag(renderer)
		renderer.write(self.text)
		self.render_close(renderer)

class Panel(Prototypes.Tag,Prototypes.Container,Prototypes.Renderable):
	def __init__(self):
		Prototypes.Container.__init__(self)
		Prototypes.Tag.__init__(self)
		self.tag="div"

	def render(self,renderer):
		self.render_tag(renderer)
		self.render_contained(renderer)
		self.render_close(renderer)

